home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / dev / gui / gtlayout.lha / Source / LTP_Atol.c < prev    next >
C/C++ Source or Header  |  1999-01-02  |  459b  |  34 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1999 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. ULONG
  17. LTP_Atol(STRPTR String)
  18. {
  19.     ULONG Value = 0;
  20.  
  21.     while(*String == ' ' || *String == '\t')
  22.         String++;
  23.  
  24.     while(*String)
  25.     {
  26.         if(*String >= '0' && *String <= '9')
  27.             Value = (Value * 10) + ((*String++) - '0');
  28.         else
  29.             break;
  30.     }
  31.  
  32.     return(Value);
  33. }
  34.